package com.demo.spring.pojo;

public class PeopleFactory {

    public People getInstance () {
        return new People(33, "object-factory");
    }
    public People createPeople(String type) {
        switch (type) {
            case "student":
                //之前简单处理逻辑
                return new Student(22, "student");
            case "teacher":
                //之前简单处理逻辑
                return new Teacher(11, "teacher");
            default:
                return null;
        }
    }

    public static People getObject () {
        return new People(66, "static-factory");
    }
}
